package org.dyndns.opendemogroup.optimizer.operations;

import java.util.Random;

import org.dyndns.opendemogroup.optimizer.IOperation;
import org.dyndns.opendemogroup.optimizer.IOptimizationProblem;
import org.dyndns.opendemogroup.optimizer.Member;

/**
 * Copies parent one to child one and parent two to child two.
 */
public class Reproduction implements IOperation
{

	public void perform ( Random randomSource, IOptimizationProblem problem,
			Member parentOne, Member parentTwo, Member childOne, Member childTwo )
	{
		int lastIndex = parentOne.getMemberSize ( ) - 1;
		// { perform reproduction one
		childOne.copyFrom ( parentOne, 0, lastIndex );
		// }
		// { perform reproduction two
		childTwo.copyFrom ( parentTwo, 0, lastIndex );
		// }

	}

}
